home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-10-28 | 5.0 KB | 178 lines | [TEXT/MPS ] |
- /*****************************************************************
-
- Program: < ATP Demo >
- File: < ATP Demo.protos >
-
- Written by Scott Kuechle
- of <Apple Macintosh Developer Technical Support>
-
- 10/92 SRK created
- 8/94 SRK Modified to use a queue of parameter
- blocks.
-
- Copyright © 1992, 1994 Apple Computer, Inc.
- All rights reserved.
-
- *****************************************************************/
-
-
- #include <types.h>
- #include <quickdraw.h>
- #include <toolutils.h>
- #include <fonts.h>
- #include <events.h>
- #include <windows.h>
- #include <dialogs.h>
- #include <menus.h>
- #include <desk.h>
- #include <textedit.h>
- #include <scrap.h>
- #include <segload.h>
- #include <osevents.h>
- #include <files.h>
- #include <devices.h>
- #include <memory.h>
- #include <appletalk.h>
- #include <lists.h>
- #include <SysEqu.h>
- #include <Script.h>
- #include <CursorCtl.h>
- #include <Resources.h>
- #include <ADSP.h>
- #include <Packages.h>
- #include <String.h>
- #include <Strings.h>
- #include <Traps.h>
- #include <GestaltEqu.h>
- #include <Errors.h>
-
-
- /*****************************************************************/
- /*
- /* R O U T I N E S
- /*
- /*****************************************************************/
- void InitQueues();
- void CheckDoneQueue();
- void CheckRequests();
- void DisplayStatusString(short whichString,Ptr displayStr);
- pascal void doGetRequestIOComp(ATPPBPtr atpPBPtr);
- void doGetRequest(ATPPBPtr atpPBPtr,
- char socket,
- short reqLength,
- Ptr reqPointer);
- pascal void doSndRequestIOComp(ATPPBPtr atpPBPtr);
- void doSndRequest(ATPPBPtr atpPBPtr,
- AddrBlock address,
- char socket,
- Ptr bdsPtr,
- short reqLength,
- Ptr reqPointer,
- char numOfBuffs);
- pascal void doSendResponseIOComp(ATPPBPtr atpPBPtr);
- void doSendResponse(ATPPBPtr atpPBPtr,
- char socket,
- Ptr bdsPtr,
- char numOfBuffs,
- char bdsSize);
- Boolean GetASocket(char *socket);
- void closeOurSocket(char socket);
- Boolean SendReqToTarget();
- void ATPLoop();
- void initializeATP();
- void removeATP();
- ATPPBPtr GetQElement(QHdrPtr qHdrPtr);
- myATPParamBlockPtr GetOurPBPtr(ATPPBPtr atpPBPtr);
- void SetOurCompletionRoutine(ProcPtr procPtr,
- ATPPBPtr atpPBPtr);
- void SendOurResponseData(ATPPBPtr atpPBPtr);
- void GetClockTime(Ptr buf);
- void SetUpATPError(OSErr err,
- StringPtr displayStr);
- void ShowATPError(ATPPBPtr atpPBPtr);
- void ShowClockTime(ATPPBPtr atpPBPtr);
- short CopyDataToBDSBuffers(BDSPtr bds,
- Ptr src,
- long srcSize);
- Boolean VerifyData(myATPParamBlockPtr myATPPbPtr);
- void ShowStatusString(StringPtr str);
- void SaveFunctionResultCode(OSErr err,
- ATPPBPtr atpPBPtr);
-
- /*****************************************************************/
- /*
- /* R O U T I N E S
- /*
- /*****************************************************************/
-
- void Terminate();
- void DoActivate (WindowPtr window, Boolean becomingActive);
- void CheckEnvirons();
- void drawPopUpTri (WindowPtr whichWindow, Rect r);
- void CopyPstr(Ptr pSource, Ptr pDest);
- void PStrCat(Ptr sourceStr, Ptr destinationStr);
- void SetUpATPError(OSErr err, StringPtr displayStr);
- void ShowError(short index);
- void FatalError(error);
- Boolean IsAppWindow(window);
- Boolean IsDAWindow(WindowPtr window);
- void DoCloseWindow (WindowPtr window);
- void outlinePopUpMenus (WindowPtr whichWindow, Rect r, Str255 itemString);
- pascal void UpdateUserItems (WindowPtr whichWindow, short theItem);
- void DoModeless (DialogPtr whichDialog, short whichItem);
- void setEachUserItem (short item);
- void DoMenuCommand (long menuResult);
- void AdjustMenus();
- void DisposeQueueMemory();
- void Exit(short message);
- void DoIdleProc();
- void AdjustCursor (Point mouse, RgnHandle region);
- void UpdateItemBorder (short item, Rect r);
- void PlotSICN (Rect theRect,SICNHand theSICN, short theIndex);
- void DoEvent (EventRecord event);
- void EventLoop();
- Boolean TrapAvailable(tNumber,tType);
- void SetupUserItems();
- void InitializeFreeQ();
- void Initialize();
- void DoDrawIcon(Boolean normalState, short item);
- void AdjustResponderIcon();
- void ShowATPError();
- void HiliteSendReqButton (short mode);
- void BuildDataSizePopUp();
-
-
-
- /*****************************************************************/
- /*
- /* R O U T I N E S
- /*
- /*****************************************************************/
-
- void registerMyName(char socket);
- void removeMyName();
- long myCompare (Str255 aStr, Str255 bStr);
- void letsSort (Ptr theBuffPtr, long numZonesGot);
- void addZonesToBuffer (Ptr LkUpBuffer,
- Ptr BufferForZoneMenu,
- short NumZonesGot,
- short CurrentTotal);
- void parseItemsAddToMenu (Ptr theBuffPtr,
- MenuHandle zoneMenu,
- short NumZonesGot);;
- Boolean zonesPresent();
- void parseLkupBuffAddToMenu (Ptr theBuffPtr,
- Ptr bigBuffer,
- MenuHandle lookupMenu,
- short NumGot,
- Boolean doObjects);
- void LookupNames (MenuHandle lookupMenu,
- Boolean doObjects);
- void BuildZoneListPhase1(MenuHandle zoneMenu);
- void BuildZoneListPhase2(MenuHandle zoneMenu);
- void GetZones(MenuHandle ZoneMenu);
- void getOurZonePhase2();
- void getOurZonePhase1();
- OSErr InitAppleTalk();
- void GetOurZone();
-